package GameEngine.Drawables.GameObjects;

import GameEngine.helper.PAppletBridge;
import processing.core.PApplet;
import processing.core.PGraphics;
import processing.core.PImage;

public class RandomBerg {
	int[] Spitzen = new int[20];

	public RandomBerg() {
		initSpitzen();
	}

	public void initSpitzen() {
		for (int i = 0; i < 20; i++) {
			Spitzen[i] = PApplet.parseInt(PAppletBridge.random(50, 170));
		}
	}

	public PImage getImage(int col) {
		PGraphics pg = PAppletBridge.createGraphics(2000, 200);
		pg.beginDraw();

		// pg.background(128, 0);
		int px = 0;
		for (int i = 0; i < 20; i++) {
			pg.fill(col);
			pg.rect(px, 200 - Spitzen[i], Spitzen[i], Spitzen[i], 7);
			px = px + 100;
		}

		pg.endDraw();

		return pg;
	}

}
